package com.hd.util.id;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * 附件id生产工具
 */
public class AttachIdGenerator {

    public static String generator(){
        String id="";
        String datetime = new SimpleDateFormat("yyyy-MM-dd_HHmmss")
                .format(new Date());
        id=datetime;
        Random random=new Random();
        int offset = random.nextInt(10000);
        id=datetime+offset;
        return id;
    }
    public static void main(String[] args){
        System.out.println(generator());
    }
}
